package com.Filter;

import javax.servlet.*;
import java.io.IOException;


public class LoginFilter implements Filter {
    public void destroy() {
        System.out.println("LoginFilter已经销毁.");
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        System.out.println("LoginFilter开始执行。");
        chain.doFilter(req, resp);
    }

    public void init(FilterConfig config) throws ServletException {
        System.out.println("LoginFilter初始化成功。");
        System.out.println("age值为："+config.getInitParameter("age"));
    }

}
